home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: d@exnet.co.uk (Damon)
-
- In article <1rro2qINNk3f@ftp.UU.NET> davidm@cimshop.UUCP (David S. Masterson) writes:
- >Shouldn't 'printf "%c" 3' output a NULL byte? I would expect that the '3'
- >would be stored in as a 4 byte integer of which the first 3 bytes are '0'.
- >The '%c' should take the byte at the address of the argument to printf (not
- >what that argument points to) and output it as an ASCII character (in this
- >case NULL). Without testing it, I'm not sure -- is this not what happens?
-
- My understanding of printf() as a normal UNIX C library function is
- that is prints the byte/character corresponding to the integer passed to
- it as in:
-
- {
- int ic;
-
- while((ic = getchar()) != EOF) { printf("%c", ic); }
- }
-
- which should be exactly equivalent to:
-
- {
- int ic;
-
- while((ic = getchar()) != EOF) { putchar(ic); }
- }
-
- If %c now behaves like %s then, IMHO, the POSIX group have goofed, big-time.
-
- --
- Damon Hart-Davis d@hd.org London UK
- Tel/Fax: +44 81 755 0077======Two jobs:
- (1) Parallelogram Editor, [1.42]
- (2) Seller of public-access news/mail & cheap Suns (mail info@exnet.co.uk).
-
-
- Volume-Number: Volume 31, Number 49
-
-